<?xml version="1.0" encoding="UTF-8"?>
<project name="${name}" default="create-jar" basedir=".">
	<property name="target.dir" value="${location}"/>
	<property name="temp.dir" value="./temp" />
	<property name="jar.dir" value="./jar" />
	<property name="bin.dir" value="" />
	
	<target name="init">
	   <mkdir dir="${r"${temp.dir}"}" />
	   <mkdir dir="${r"${jar.dir}"}" />
	</target>

	<target name="deploy" depends="init">
		<copy todir="${r"${temp.dir}"}/">
			<fileset dir="${r"${bin.dir}"}">
				<include name="**/*.*" />
			</fileset>
		</copy>
		<copy todir="${r"${jar.dir}"}/${name}/">
					<fileset dir="${r"${temp.dir}"}/bin/">
						<include name="**/*.*" />
					</fileset>
		</copy>
		<copy todir="${r"${jar.dir}"}/${name}/lib">
			<fileset dir="lib/">
				<include name="**/*.*" />
			</fileset>
		</copy>
		<copy todir="${r"${jar.dir}"}/${name}/META-INF">
					<fileset dir="META-INF/">
						<include name="**/*.*" />
					</fileset>
		</copy>
		<delete dir="${r"${temp.dir}"}" />
	</target>
	
	<target name="create-jar" depends="deploy">
				<jar jarfile="${r"${jar.dir}"}/${name}_${version}.jar" compress="true" manifest="META-INF/MANIFEST.MF">
					<fileset dir="${r"${jar.dir}"}/${name}">
						<include name="**/*.*" />
					</fileset>
				</jar>
		       <copy todir="${r"${target.dir}"}/">
					<fileset dir="${r"${jar.dir}"}/">
						<include name="**/${name}_${version}.jar" />
					</fileset>
				</copy>  
				<delete dir="${r"${jar.dir}"}" />  
	</target>
</project>